/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.postbar.util;

import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

/**
 *
 * @author Administrator
 */
public class NewClass {

    public static void main(String[] args) {
        String other_urls = "https://192.33.23.3:4545/siidfn?eogrpmdmkiwpfkk.png";
        String endsignal = "";
        try {
            String str = other_urls.substring(other_urls.lastIndexOf("/") + 1, other_urls.length());
            System.out.println(str);
            endsignal = str.substring(str.lastIndexOf("."), str.length());
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        System.out.println(endsignal);

        String json = "{\"record_list\":[{\"name\":\"ee\",\"age\":3}]}";
        JSONObject ob = null;
        try {
            ob = JSONObject.fromObject(json);
        } catch (Exception e) {
        }
        JSONArray dataArray = ob.getJSONArray("record_list");

        for (int i = 0; i < dataArray.size(); i++) {
            JSONObject jsonObject = dataArray.getJSONObject(i);
            jsonObject.put("sourceSystemCode", "102");
        }
        System.out.println(ob);
        System.out.println("");

        String[] a = {"1", "2"};
        String[] picArr = new String[]{};
//        try {
//            picArr = a;
//        } catch (Exception e) {
//        }

        System.out.println(picArr.length);

        SimpleDateFormat sdfdq = new SimpleDateFormat("yyyyMMddHH");
        System.out.println(new Date());
        String currenttime = sdfdq.format(new Date());
        System.out.println(currenttime);

        try {
            SimpleDateFormat sdfd = new SimpleDateFormat("yyyyMMddHHmmss");
            Date parse = sdfd.parse("20170328160300");
            SimpleDateFormat sd = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
            String time = sd.format(parse);
            System.out.println(Arrays.toString(time.split(" ")[0].split("/")));
            System.out.println(Long.parseLong(time.split(" ")[1].split(":")[0]));
        } catch (Exception e) {
            System.out.println(e);
        }
    }
}
